<?php

namespace app\api\model;

use think\Model;
use think\Request;
use think\Db;

class Integral extends Model
{
  	//我的积分
	public function Myintegral(){
		$uid = Request::instance()->header()['uid'];
      	$integral['integral'] = Db::table('xmr_integral')->where('uid', $uid)->select();
      	foreach($integral['integral'] as $k=>&$v){
        	$v['create_time'] = date('Y-m-d H:i', $v['create_time']);
        }
		$integral['total_int'] = count($integral['integral']);
      	return $integral;
    }
}
